package jmine.tec.web.wicket.component.menu.cfg;

import org.springframework.beans.factory.FactoryBean;

/**
 * Classe base para MenuConfigFactoryBean
 * 
 * @author lundberg
 */
public abstract class AbstractMenuConfigFactoryBean implements FactoryBean {

    /**
     * {@inheritDoc}
     */
    public final Object getObject() throws Exception {
        return this.createMenuConfig();
    }

    /**
     * Cria o MenuConfig
     * 
     * @return menu config
     */
    protected abstract MenuConfig createMenuConfig();

    /**
     * {@inheritDoc}
     */
    public final Class getObjectType() {
        return MenuConfig.class;
    }

    /**
     * {@inheritDoc}
     */
    public final boolean isSingleton() {
        return true;
    }
}
